﻿using Microsoft.Extensions.Options;
using MongoDB.Driver;
using TaskoMask.BuildingBlocks.Infrastructure.MongoDB;
using TaskoMask.Services.Tasks.Read.Api.Domain;

namespace TaskoMask.Services.Tasks.Read.Api.Infrastructure.DbContext;

/// <summary>
///
/// </summary>
public class TaskReadDbContext : MongoDbContext
{
    #region Fields


    #endregion

    #region Ctors


    public TaskReadDbContext(IOptions<MongoDbOptions> mongoDbOptions)
        : base(mongoDbOptions)
    {
        Tasks = GetCollection<Task>();
        Comments = GetCollection<Comment>();
        Activities = GetCollection<Activity>(nameof(Activities));
    }

    #endregion

    #region Properties

    public IMongoCollection<Task> Tasks { get; }
    public IMongoCollection<Comment> Comments { get; }
    public IMongoCollection<Activity> Activities { get; }

    #endregion
}
